package il.ac.braude.sona.ui.skeleton;

import il.ac.braude.sona.control.MainFlowControl;
import il.ac.braude.sona.database.User;
import il.ac.braude.sona.strings.Resources;
import il.ac.braude.sona.ui.forms.ImagePanel;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Toolkit;

import javax.swing.JFrame;
import javax.swing.JPanel;

public class MainMenuFrame extends SONAFrame {
	public MainMenuFrame(MainFlowControl mainFlowControl, User user) {
		setTitle(Resources.Strings.BraudeSystem + " - " + user.getName());
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setLayout(new BorderLayout());
		
		ImagePanel imagePanel = new ImagePanel();
		imagePanel.setBackground(Resources.Images.Background,true);
		JPanel somePanel = new JPanel();
		somePanel.add(imagePanel);
		add(somePanel,BorderLayout.NORTH);
		add(new ButtonPanel(mainFlowControl,user),BorderLayout.CENTER);
	}

	public void showMenu() {
		Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
		pack();
		setLocation(dim.width/2 - getWidth()/2, dim.height/2 - getHeight()/2);
		setVisible(true);
	}
}
